<table class="items">
    <thead>
        <tr>
            <th class="no"><?php echo Yii::t('BackEnd', 'No.')?></th>
            <th class="large"><?php echo Yii::t('BackEnd', 'Large')?></th>
            <th class="medium"><?php echo Yii::t('BackEnd', 'Medium')?></th>
            <th class="small"><?php echo Yii::t('BackEnd', 'Small')?></th>
            <th class="default"><?php echo Yii::t('BackEnd', 'Default')?></th>
        </tr>
    </thead>
    <tbody>
        <?php
            $index=0;
            foreach($images as $item):
            $imageSourceUrl = 'http://'.$_SERVER['SERVER_NAME'].CHtml::encode($item->normal);
        ?>
        <tr class="<?php echo ($index%2)?'odd':'even'?>">
            <td class="fixed"><?php echo $index+1?></td>
            <td>
                <a href="<?php echo Yii::app()->createUrl('site/cropImage', array('id'=> $item->id, 'type'=>'large', 'src'=>$imageSourceUrl, 'modelName'=>$modelName, 'modelId'=>$modelId));?>">
                    <img alt="large-<?php echo $item->name;?>" class="img-large" id="img-large-<?php echo $item->id; ?>" src="<?php echo $item->large.'?v='.time();?>" title="<?php echo Yii::t('BackEnd','Click to edit');?>"/>
                </a>
            </td>
            <td>
                <a href="<?php echo Yii::app()->createUrl('site/cropImage', array('id'=> $item->id, 'type'=>'medium','src'=>$imageSourceUrl, 'modelName'=>$modelName, 'modelId'=>$modelId));?>">
                    <img alt="medium-<?php echo $item->name;?>" class="img-medium" id="img-medium-<?php echo $item->id; ?>" src="<?php echo $item->medium.'?v='.time();?>"  title="<?php echo Yii::t('BackEnd','Click to edit');?>">
                </a>
            </td>
            <td>
                <a href="<?php echo Yii::app()->createUrl('site/cropImage', array('id'=> $item->id, 'type'=>'small','src'=>$imageSourceUrl, 'modelName'=>$modelName, 'modelId'=>$modelId));?>">
                    <img alt="small-<?php echo $item->name;?>" class="img-small" id="img-small-<?php echo $item->id; ?>" src="<?php echo $item->small.'?v='.time();?>" title="<?php echo Yii::t('BackEnd','Click to edit');?>"/>
                </a>
            </td>
            <td>
                <?php if($item->is_default==1){?>
                <a href="<?php echo Yii::app()->createUrl('site/cropImage', array('id'=> $item->id, 'type'=>'thumbnail','src'=>$imageSourceUrl, 'modelName'=>$modelName, 'modelId'=>$modelId));?>">
                <img id="img-thumbnail-<?php echo $item->id; ?>" class="img-thumbnail" alt="thumb-<?php echo $item->name;?>" src="<?php echo $item->thumb.'?v='.time();?>" title="<?php echo Yii::t('BackEnd', 'Edit thumbnail image');?>"/></a>
                <?php } else{ ?>
                <a class="link-to-default" id="<?php echo $item->id; ?>" rev="<?php echo $modelId;?>" rel="<?php echo $modelName;?>" onclick="$.setDefaultImage(this);"><?php echo Yii::t('BackEnd', 'Set to default image')?></a>
                <?php }?>
            </td>
        </tr>
        <?php $index++;?>
        <?php endforeach;?>
    </tbody>
</table>
